package games.miniPacman;

import graphics.Bitmap2D;

public class PlayField extends Bitmap2D{

	
	private static final int  OBJECT_TYPE_FOOD	= 0;
	private static final int  OBJECT_TYPE_WALL	= 1;
	
	private static final short COLOR_WALL	= 0x0f00;
	private static final short COLOR_FOOD	= 0x04A;
	private static final short COLOR_CHERRY	= 0x000f;

	
	
	
	private static final int playfieldData[] ={0x55555555,0x00004001,0x00004151,0x00004151,0x1,0x00051,0x401,0x55,0,0,0,0,0,0,0,55555555};
	
	
	
	
	
	public PlayField() {
		super(16, 16);
		// TODO Auto-generated constructor stub
	}

	
	
	public void init()
	{
		int xCounter;
		int yCounter;
		int tmpValue;
		int objectType;
		short color;
		
		
		for (yCounter=0;yCounter<16;yCounter++)
		{
			tmpValue=playfieldData[yCounter];
			
			for (xCounter=0;xCounter<16;xCounter++)
			{
				objectType=tmpValue&0x3;
				tmpValue>>=2;
			
				switch (objectType)
				{
				case OBJECT_TYPE_FOOD:
					setPixel(xCounter,yCounter, COLOR_FOOD);
					break;

					
				case OBJECT_TYPE_WALL:
					setPixel(xCounter,yCounter, COLOR_WALL);
					break;

				
				}
			
			}
		}
	}
	
	
	
}
